import { Entity, Column, PrimaryGeneratedColumn,ManyToMany, ManyToOne, JoinColumn, OneToOne , BaseEntity, OneToMany } from 'typeorm';
import { Video } from '../video/video.entity'
import { WithdrawingEnum } from './wxUser.enum';

@Entity('wx_user')
export class WxUser extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ name: 'name' })
  name: string;

  @Column({ name: 'initname' })
  initname: string;

  @Column({ name: 'phone' })
  phone: string;

  @Column({name: 'countryCode'})
  countryCode: number;

  @Column({ name: 'wx' })
  wx: string;

  @Column({ name: 'create_time' })
  create_time: Date;

  @Column({ name: 'openid' })
  openid: string;

  @Column({ name: 'wallet_balance' })
  wallet_balance: string;

  @Column({ name: 'wallet_balance_history' })
  wallet_balance_history: string;

  @Column({ name: 'wallet_balance_update_time' })
  wallet_balance_update_time: Date;

  @Column({ name: 'withdrawing' })
  withdrawing: WithdrawingEnum;

  @Column({ name: 'alipay_account' })
  alipay_account: string;

  @Column({ name: 'alipay_account_name' })
  alipay_account_name: string;

  @Column({ name: 'wx_app_openid' })
  wx_app_openid: string;
  
  @Column({ name: 'avatar_img' })
  avatar_img: string;

  @Column({ name: 'avatar_img_id' })
  avatar_img_id: string;

  @Column({ name: 'login_code' })
  login_code: string;

  @Column({ name: 'id_card' })
  id_card: string;

  @Column({ name: 'concern_is_update' })
  concern_is_update: number;

  @OneToMany(() => Video, (photo) => photo.wx_user_info)
  video_: Video[];
}
